package
{
	import org.flixel.FlxGroup;
	import org.flixel.FlxSprite;
	import org.flixel.FlxText;

	public class AchievementReport extends FlxGroup
	{
		protected static var ACHIEVE_X:int = 188;
		protected static var ACHIEVE_Y:int = 20;
		public function AchievementReport(achievement:int)
		{
			var aInfo:AchievementInfo = Elemental.achievements.getAchievement(achievement);
			this.add(new FlxSprite(ACHIEVE_X,ACHIEVE_Y,Res.achievReportBG));
			this.add(new FlxSprite(ACHIEVE_X + 30, ACHIEVE_Y + 10, aInfo.getIcon()));
			var tmp:Array = aInfo.getText().split("!");
			var name:String =  new String(tmp[0])
			var txt:FlxText = new FlxText(ACHIEVE_X + 2,ACHIEVE_Y + 100,136, name, false);
			if (name.length > 19) {
				txt.setFormat("Arial", 12, 0x000000, "center");
			} else {
				txt.setFormat("Arial", 14, 0x000000, "center");
			}
			this.add(txt);
		}
	}
}